package com.steam.xbcc.fallback;

import com.steam.xbcc.doc.CourseDoc;
import com.steam.xbcc.feign.CourseEsService;
import com.steam.xbcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseEsServiceFallbackFactory implements FallbackFactory<CourseEsService> {
    @Override
    public CourseEsService create(Throwable throwable) {
        return new CourseEsService() {
            @Override
            public JSONResult saveCourseEs(CourseDoc courseDoc) {
                return JSONResult.error();
            }
        };
    }
}
